package demoMod.stsconsole.cards.red;

import demoMod.stsconsole.cards.AbstractCard;
import demoMod.stsconsole.characters.AbstractPlayer;
import demoMod.stsconsole.core.AbstractCreature;
import demoMod.stsconsole.powers.BerserkPower;
import demoMod.stsconsole.powers.VulnerablePower;

public class Berserk extends AbstractCard {
    public static final String ID = "Berserk";

    public Berserk() {
        super(ID);
        this.color = CardColor.RED;
        this.cost = 0;
        this.rarity = CardRarity.RARE;
        this.type = CardType.POWER;
        this.target = CardTarget.SELF;
        this.magicNumber = 2;
    }

    @Override
    public void upgrade() {
        if (!this.upgraded) {
            this.upgraded = true;
            this.name = this.name + "+";
            this.upgradeTimes++;
            this.magicNumber--;
        }
    }

    @Override
    public boolean use(AbstractPlayer p, AbstractCreature target) {
        p.applyPower(p, new VulnerablePower(p, this.magicNumber));
        p.applyPower(p, new BerserkPower(1));
        return true;
    }
}
